package com.cxmx.escort.common.utils.result;

/**
 * @param
 * @author chenkuidou
 * @description 自定义返回code枚举
 * @date 2018/11/23 11:46
 * @return
 **/
public enum ResultCode {
    SUCCESS("操作成功", 1), FAIL("操作失败", 0),
    UNREGISTERED("用户未注册", 2), NOLOGIN("用户未登录", -1);
    private String msg;
    private int code;

    private ResultCode(String msg, int code) {
        this.msg = msg;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    //覆盖方法
    @Override
    public String toString() {
        return this.code + "_" + this.msg;
    }
}
